<template>
  <yt-viewer>
    <create-entity />
    <route-plan />
  </yt-viewer>
</template>

<script setup lang="ts">
import {
  onLeftClick,
  onRightClick,
} from "yt-cesium";
import { ScreenSpaceEventHandler, Viewer } from "cesium";
import CreateEntity from "./components/createEntity.vue";
import RoutePlan from "./plugin/route-plan/route-plan.vue";
import YtViewer from "./cesium/components/YtViewer.vue";

const close = onLeftClick((e: ScreenSpaceEventHandler.PositionedEvent) => {
  console.log(e, "第一个事件");
  close?.();
});
onLeftClick((e: ScreenSpaceEventHandler.PositionedEvent) => {
  console.log(e, "第二个事件");
});

onRightClick(
  (e: unknown) => {
    console.log("right", e as Viewer);
  },
  {
    isEntity: false,
  }
);

</script>

<style scoped lang="less">
#cesium-box {
  height: 100%;
}
</style>
<style lang="less">
#cesium-box {
  position: relative;

  .cesium-child {
    z-index: 10;
  }
}
</style>
